import request from '@/utils/request'

export function examine(data) {
  return request({
    url: `/api/yxTechnician/examine`,
    method: 'post',
    data
  })
}
export function addTechnician(data) {
  return request({
    url: `/api/yxTechnician`,
    method: 'post',
    data
  })
}

// 修改技师
export function yxTechnician(data) {
  return request({
    url: `/api/yxTechnician`,
    method: 'put',
    data
  })
}
// 技师详情
export function details(id) {
  return request({
    url: `/api/yxTechnician/details/get/` + id,
    method: 'get'
  })
}
// 技师详情
export function deleteStore(data) {
  return request({
    url: `/api/yxTechnician`,
    method: 'delete',
    data
  })
}

// 添加出行方式
export function addModes(data) {
  return request({
    url: `/api/yxTechnicianTravelModes`,
    method: 'post',
    data
  })
}
// 修改出行方式
export function editModes(data) {
  return request({
    url: `/api/yxTechnicianTravelModes`,
    method: 'put',
    data
  })
}
// 删除出行方式
export function delModes(data) {
  return request({
    url: `/api/yxTechnicianTravelModes`,
    method: 'delete',
    data
  })
}

// 行业分类
export function yxTechnicianCategory(data) {
  return request({
    url: `/api/yxTechnicianCategory`,
    method: 'get'
  })
}

// 添加分类
export function add(data) {
  return request({
    url: `/api/yxTechnicianCategory`,
    method: 'post',
    data
  })
}

// 分类删除
export function del(data) {
  console.log('data', data)
  return request({
    url: `/api/yxTechnicianCategory/` + data.join(','),
    method: 'delete'
  })
}
// 分类修改
export function edit(data) {
  return request({
    url: `/api/yxTechnicianCategory`,
    method: 'put',
    data
  })
}
// 新增项目

export function addItem(data) {
  return request({
    url: `/api/yxTechnicianItem`,
    method: 'post',
    data
  })
}
// 修改项目

export function editItem(data) {
  return request({
    url: `/api/yxTechnicianItem`,
    method: 'put',
    data
  })
}
// 新增项目

export function delItem(data) {
  return request({
    url: `/api/yxTechnicianItem`,
    method: 'delete',
    data
  })
}

export function initData(data) {
  return request({
    url: `/api/yxTechnician?page=${data.page}&size=${data.size}&technicianName=${data.technicianName}`,
    method: 'get'

  })
}

export function examineItem(data) {
  return request({
    url: `/api/yxTechnicianItem/examine/${data.id}?status=${data.state}&remark=${data.remark ? data.remark : ''}`,
    method: 'get'

  })
}

export default { yxTechnicianCategory, add, del, edit, addModes, editModes, delModes, addItem, editItem, initData }

